package MetroLab.Utils;

/**
 *
 * @author plus
 */

import java.util.*;
import java.io.File;

/**
 *
 * @author plus
 */
public class PathRes
{

    private static HashMap<String, String> PathTable = null;

    public PathRes()
    {
        init();
    }

    
    public static void init()
    {
        PathTable = new HashMap<String, String>();
        PathTable.put("Model.Rail.10MLift", new File("res/model/rail/10mLiftRail.obj").getAbsolutePath());
        PathTable.put("Model.Rail.10MGround", new File("res/model/rail/10mGroundRail.obj").getAbsolutePath());
        PathTable.put("Model.Rail.10MDual", new File("res/model/rail/10mDualRail.obj").getAbsolutePath());
        PathTable.put("Image.SpeedDashBack", new File("res/image/speeddashback.png").getAbsolutePath());
        PathTable.put("Rail.Bridage.50MDaozha", new File("res/model/rail/50Mdaozha.obj").getAbsolutePath());
        PathTable.put("Rail.Bridage.50MDaozhaStation", new File("res/model/rail/50MdaozhaStation.obj").getAbsolutePath());
        PathTable.put("Rail.Bridage.20MLift", new File("res/model/rail/20mSingleBridge.obj").getAbsolutePath());
        PathTable.put("Rail.Bridage.50MLift", new File("res/model/rail/50mSingleBridge.obj").getAbsolutePath());
        PathTable.put("Train.AC01.A", new File("res/model/train/AC01/A.obj").getAbsolutePath());
        PathTable.put("Train.AC01.B", new File("res/model/train/AC01/B.obj").getAbsolutePath());
        PathTable.put("Train.AC01.C", new File("res/model/train/AC01/C.obj").getAbsolutePath());
        PathTable.put("Train.AC01.Cr", new File("res/model/train/AC01/C.obj").getAbsolutePath());
        PathTable.put("Train.AC01.Br", new File("res/model/train/AC01/Br.obj").getAbsolutePath());
        PathTable.put("Train.AC01.Ar", new File("res/model/train/AC01/Ar.obj").getAbsolutePath());
        PathTable.put("Train.AC01.Bogie", new File("res/model/train/AC01/Bogie.obj").getAbsolutePath());
        PathTable.put("Surrounding.UM1", new File("res/model/surround/surr.obj").getAbsolutePath());
    }

    public static String getPath(String Key) throws Exception
    {
        if (PathTable == null)
        {
            init();
        }
        //
        String res = PathTable.get(Key);
        if (res == null)
        {
            System.err.println(Key+" Not Exist!");
        }
        return res;
    }

    public static void main(String args[])
    {
        init();
        try
        {
            System.out.println(getPath("Model/Room"));
        } catch (Exception e)
        {
            e.printStackTrace();
        }
    }
}
